<div bsModal #createOrEditModal="bs-modal" (onShown)="onShown()" aria-labelledby="createOrEditModal" class="modal fade"
    tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog modal-md">
        <div class="modal-content">
            <form *ngIf="active" #ProductsForm="ngForm" novalidate (ngSubmit)="save()" autocomplete="off">
                <div class="modal-header">
                    <h4 class="modal-title">
                        <span *ngIf="operationType=='add'">{{l("CreateNewResource")}}</span>
                        <span *ngIf="operationType=='edit'">{{l("EditResource")}}</span>
                    </h4>
                    <button type="button" class="close" (click)="close()" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body">
                  <div class="row">
                    <div class="col-6">
                      <div class="form-group">
                        <label>{{l('Name')}}</label>
                        <input class="form-control" name="name" type="text" [(ngModel)]="resource.displayName" />
                      </div>
                      <div class="form-group">
                          <label>{{l('Angle')}}</label>
                          <input class="form-control" required name="angle" type="text" [(ngModel)]="resource.angle" />
                      </div>
                      <div class="form-group">
                        <label><input name="isDefault" type="checkbox" [(ngModel)]="resource.isDefault" />{{l('isDefault')}}</label>
                    </div>
                    </div>
                    <div class="col-6">
                        <label>{{l('Resource')}}</label>
                        <div class="form-group">
                            <app-fileupload [fileUrl]="resource.imageUrl" 
                                (onUpLoadEvent)="onUpload($event)" (onBeforeSendEvent)="onBeforeSend($event)"></app-fileupload>
                        </div>
                    </div>
                </div>
                </div>
                <div class="modal-footer">
                    <button [disabled]="saving" type="button" class="btn btn-primary" (click)="close()">{{l("Cancel")}}</button>
                    <button type="submit" class="btn btn-primary blue" [disabled]="!ProductsForm.form.valid"
                        [buttonBusy]="saving" [busyText]="l('SavingWithThreeDot')">
                        <i class="fa fa-save"></i>
                        <span>{{l("Save")}}</span>
                    </button>
                </div>
            </form>
        </div>
    </div>
</div>